# 作者：小七
# 2024年12月27日

def use_tuple():
    info_tuple = ("zhangsan", 18, 1.75)
    for i in info_tuple:
        print(i)

    print("-" * 50)
    print(info_tuple[0])

    print(info_tuple.count("zhangsan"))

    print(len(info_tuple))


def use_str():
    info_tuple1 = ("小明", 21, 1.85)

    print("%s 年龄是 %d 身高是 %.2f" % info_tuple1)
    info_str = "%s 年龄是 %d 身高是 %.2f" % info_tuple1
    print(info_str)
    print(f'使用f{info_tuple1}')


def use_tuple_error():
    a = []
    b = ()
    print(type(a))
    print(type(b))
    a = [1]
    b = (1)
    print(type(a))
    print(type(b))
    b = (1,)
    print(type(b))


if __name__ == '__main__':
    # use_tuple()
    # use_str()
    use_tuple_error()
